/**
 * @param {character[]} s
 * @return {void} Do not return anything, modify s in-place instead.
 */
 var reverseString = function(s) { //头尾指针
    let head=0,end=s.length-1;
    while(head<end){
        let a=s[head];
        s[head]=s[end];
        s[end]=a;
        head++;
        end--;
    }
    return s;
};
let s="niahao";
console.log(reverseString(s));